package com.chat.push.push

import android.content.Context
import com.chat.base.WKBaseApplication
import com.chat.base.utils.WKDeviceUtils
import com.chat.push.service.PushModel
import com.meizu.cloud.pushsdk.MzPushMessageReceiver
import com.meizu.cloud.pushsdk.platform.message.RegisterStatus

/**
 * 魅族推送
 */
class FlymePushMessageReceiver: MzPushMessageReceiver() {

    override fun onRegisterStatus(context: Context?, status: RegisterStatus?) {
        super.onRegisterStatus(context, status)
        if (!status?.pushId.isNullOrEmpty()) {
            val packageName = WKDeviceUtils.getInstance().getPackageName(WKBaseApplication.getInstance().context)
            PushModel.getInstance().registerDeviceToken(status?.pushId, packageName, "app-魅族")
        }
    }
}